<template>
	<view>
		<view class='shoppingCart copy-data' v-if="canShow">
			<view class='labelNav flex-row row-around row-middle'>
				<view class='item'><text class='iconfont icon-xuanzhong'></text>100%正品保证</view>
				<view class='item'><text class='iconfont icon-xuanzhong'></text>所有商品精挑细选</view>
				<view class='item'><text class='iconfont icon-xuanzhong'></text>售后无忧</view>
			</view>
			<view class='nav flex-row row-between-wrapper'>
				<view>购物数量 <text class='num font-num'>{{cartCount}}</text></view>
				<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
					class='administrate flex-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
				</view>
			</view>
			<view v-if="(cartList.valid.length > 0 || cartList.invalid.length > 0) && canShow ">
				<view class='list'>
					<checkbox-group @change="checkboxChange">
						<block v-for="(item,index) in cartList.valid" :key="index">
							<view class='item flex-row row-between-wrapper'>
								<!-- #ifdef MP -->
								<checkbox :value="item.carId" :checked="item.checked" />
								<!-- #endif -->
								<!-- <navigator :url='"/pages/goods_details/index?id="+item.product_id' hover-class='none'
									class='picTxt flex-row row-between-wrapper'> -->
								<view class='picTxt flex-row row-between-wrapper'>
									<view class='pictrue'>
										<image v-if="item.productImage" :src='item.productImage'>
										</image>
										<image v-else :src='item.productImage'></image>
									</view>
									<view class='text'>
										<view class='line1'>
											{{item.productName}}
										</view>
										<view class='infor line1' v-if="item.specifications">
											属性：{{item.specifications}}</view>
										<!-- 2024-01-21 -->
										<!-- <view class='money' v-if="item.productPrice && userType == 'STORE'">￥{{item.productPrice || 0}}</view> -->
										<view class='money' v-if="item.proxyPrice && userType == 'STORE'">
											￥{{item.proxyPrice || item.salePrice}}</view>
										<view class='money' v-else-if="item.productPrice && userType == 'SALE'">
											￥{{item.productPrice || item.salePrice}}</view>
										<view class='money' v-else>￥{{item.salePrice || 0}}</view>

									</view>
									<view class='carnum flex-row row-center-wrapper'>
										<view class="reduce" :class="item.numSub ? 'on' : ''"
											@click.stop='subCart(index)'>-</view>
										<!-- <view class='num'>{{item.buyNumber}}</view> -->
										<view class="num">
											<input type="number" v-model="item.buyNumber" @click.stop
												@input="iptCartNum(index)" disabled="" @blur="blurInput(index)" />
										</view>
										<view class="plus" :class="item.numAdd ? 'on' : ''"
											@click.stop='addCart(index)'>+</view>
									</view>
									<!-- </navigator> -->
								</view>
							</view>
						</block>
					</checkbox-group>
				</view>
				<!-- <view class='invalidGoods' v-if="cartList.invalid.length > 0">
					<view class='goodsNav flex-row row-between-wrapper'>
						<view @click='goodsOpen'><text class='iconfont'
								:class='goodsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>失效商品</view>
						<view class='del' @click='unsetCart'><text class='iconfont icon-shanchu1'></text>清空</view>
					</view>
					<view class='goodsList' :hidden='goodsHidden'>
						<block v-for="(item,index) in cartList.invalid" :key='index'>
							<view class='item flex-row row-between-wrapper'>
								<view class='invalid'>失效</view>
								<view class='pictrue'>
									<image v-if="item.productInfo.attrInfo" :src='item.productInfo.attrInfo.image'>
									</image>
									<image v-else :src='item.productInfo.image'></image>
								</view>
								<view class='text flex-row row-column-between'>
									<view class='line1 name'>{{item.productInfo.store_name}}</view>
									<view class='infor line1' v-if="item.productInfo.attrInfo">
										属性：{{item.productInfo.attrInfo.suk}}</view>
									<view class='flex-row row-between-wrapper'>
										<view>￥{{item.truePrice}}</view>
										<view class='end'>该商品已失效</view>
									</view>
								</view>
							</view>
						</block>
					</view>
				</view> -->
				<view class='loadingicon flex-row row-center-wrapper' v-if="cartList.invalid.length&&loadend">
					<text class='loading iconfont icon-jiazai'
						:hidden='loadingInvalid==false'></text>{{loadTitleInvalid}}
				</view>
			</view>
			<view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0 && canShow">
				<view class='pictrue'>
					<image src='../../../static/images/noCart.png'></image>
				</view>
			</view>
			<view style='height:120rpx;color: #F5F5F5;'></view>
			<view class='footer flex-row row-between-wrapper' v-if="cartList.valid.length > 0 && canShow">
				<view>
					<checkbox-group @change="checkboxAllChange">
						<checkbox value="all" :checked="!!isAllSelect" />
						<text class='checkAll'>全选({{selectValue.length}})</text>
					</checkbox-group>
				</view>
				<view class='money flex-row row-middle' v-if="footerswitch==true">
					<text class='font-color'>￥{{selectCountPrice}}</text>
					<form @submit="subOrder">
						<button class='placeOrder bg-color' formType="submit">去结算</button>
					</form>
				</view>
				<view class='button flex-row row-middle' v-else>
					<form @submit="subDel">
						<button class='bnt' formType="submit">删除</button>
					</form>
				</view>
			</view>
		</view>
		<!-- <productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
			@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" @goCat="reGoCat"
			id='product-window'></productWindow> -->
		<view class="uni-p-b-98"></view>
	</view>
</template>

<script>
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		mapGetters
	} from "vuex";
	import {
		addToCar,
		getUserCar,
		delUserCarSel
	} from "@/api/order.js";
	// import productWindow from '@/components/productWindow';
	export default {
		components: {
			// productWindow,
		},
		data() {
			return {
				canShow: false,
				cartCount: 0,
				footerswitch: true,
				cartList: {
					valid: [],
					invalid: []
				},
				isAllSelect: false, //全选
				selectValue: [], //选中的数据
				selectCountPrice: 0.00,
				loading: false,
				loadend: false,
				loadTitle: '我也是有底线的', //提示语
				attr: {
					cartAttr: false,
					productAttr: [],
					productSelect: {}
				},
				productValue: [], //系统属性
				storeInfo: {},
				attrValue: '', //已选属性
				attrTxt: '请选择', //属性页面提示
				cartId: 0,
				product_id: 0,
				newData: {},
				activeRouter: ''
			};
		},
		computed: mapGetters(['isLogin', 'uid', 'userType']),
		onLoad(options) {

			let that = this;
			if (that.isLogin == false) {
				toLogin();
			}
			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
			let curRoute = routes[routes.length - 1].route //获取当前页面路由
			this.activeRouter = '/' + curRoute
		},
		onShow() {
			this.canShow = false
			if (this.isLogin == true) {
				this.loadend = false;
				this.cartList.valid = [];
				this.getCartList();
				// this.getCartNum();
				this.footerswitch = true;
				this.cartList = {
						valid: [],
						invalid: []
					},
					this.isAllSelect = false; //全选
				this.selectValue = []; //选中的数据
				this.selectCountPrice = 0.00;
				this.cartCount = 0;
			};
		},
		methods: {
			subDel: function(event) {
				let that = this,
					selectValue = that.selectValue;
				if (selectValue.length > 0)
					delUserCarSel({
						userInfoId: that.uid,
						carIdArrStr: selectValue.join(",")
					}).then(res => {
						that.loadend = false;
						that.page = 1;
						that.cartList.valid = [];
						that.getCartList();
					});
				else
					return that.$util.Tips({
						title: '请选择产品'
					});
			},

			subOrder(event) {
				console.log(event)
				let that = this,
					selectValue = that.selectValue;
				if (selectValue.length > 0) {
					uni.navigateTo({
						url: '/pages/goods/order_confirm_cart/index?cartId=' + selectValue.join(',')
					});
				} else {
					return that.$util.Tips({
						title: '请选择产品'
					});
				}
			},
			checkboxAllChange: function(event) {
				let value = event.detail.value;
				console.log(value);
				if (value.length > 0) {
					this.setAllSelectValue(1)
				} else {
					this.setAllSelectValue(0)
				}
			},
			setAllSelectValue: function(status) {
				let that = this;
				let selectValue = [];
				let valid = that.cartList.valid;
				if (valid.length > 0) {
					let newValid = valid.map(item => {
						if (status) {
							if (that.footerswitch) {
								item.checked = true;
								selectValue.push(item.carId);
							} else {
								item.checked = true;
								selectValue.push(item.carId);
							}
							that.isAllSelect = true;
						} else {
							item.checked = false;
							that.isAllSelect = false;
						}
						return item;
					});
					that.$set(that.cartList, 'valid', newValid);
					that.selectValue = selectValue;
					that.switchSelect();
				}
			},
			checkboxChange: function(event) {
				let that = this;
				let value = event.detail.value;
				console.log(value);
				let valid = that.cartList.valid;
				let arr1 = [];
				let arr2 = [];
				let arr3 = [];
				let newValid = valid.map(item => {
					if (that.inArray(item.carId, value)) {
						if (that.footerswitch) {
							item.checked = true;
							arr1.push(item);
						} else {
							item.checked = true;
							arr1.push(item);
						}
					} else {
						item.checked = false;
						arr2.push(item);
					}
					return item;
				});
				if (that.footerswitch) {
					arr3 = arr2.filter(item => !item.carId);
				}
				that.$set(that.cartList, 'valid', newValid);
				that.isAllSelect = newValid.length === arr1.length + arr3.length;
				that.selectValue = value;
				that.switchSelect();
			},
			inArray: function(search, array) {
				for (let i in array) {
					if (array[i] == search) {
						return true;
					}
				}
				return false;
			},
			switchSelect: function() {
				let that = this;
				let validList = that.cartList.valid;
				let selectValue = that.selectValue;
				let selectCountPrice = 0.00;
				if (selectValue.length < 1) {
					that.selectCountPrice = selectCountPrice;
				} else {
					for (let index in validList) {
						if (that.inArray(validList[index].carId, selectValue)) {
							if (that.userType == 'STORE') {
								// 2024-01-21
								// selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index]
								// 	.buyNumber, validList[
								// 		index].productPrice || 0))

								selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[
										index]
									.buyNumber, validList[
										index].proxyPrice || validList[
										index].salePrice))
							} else if (that.userType == 'SALE') {
								selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[
										index]
									.buyNumber, validList[
										index].productPrice || validList[
										index].salePrice))
							} else {
								selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[
										index]
									.buyNumber, validList[
										index].salePrice || 0))
							}

						}
					}
					that.selectCountPrice = selectCountPrice;
				}
			},
			/**
			 * 购物车手动填写
			 * 
			 */
			iptCartNum: function(index) {
				let item = this.cartList.valid[index];
				if (item.buyNumber) {
					this.setCartNum(item.proDetailId, item.buyNumber);
				}
				this.switchSelect();
			},
			blurInput: function(index) {
				let item = this.cartList.valid[index];
				console.log(item)
				if (!item.buyNumber) {
					item.buyNumber = 1;
					this.$set(this.cartList, 'valid', this.cartList.valid)
				}
			},
			subCart: function(index) {
				let that = this;
				let status = false;
				let item = that.cartList.valid[index];
				item.buyNumber = Number(item.buyNumber) - 1;
				if (item.buyNumber < 1) status = true;
				if (item.buyNumber <= 1) {
					item.buyNumber = 1;
					item.numSub = true;
				} else {
					item.numSub = false;
					item.numAdd = false;
				}
				if (false == status) {
					that.setCartNum(item.proDetailId, -1, function(data) {
						that.cartList.valid[index] = item;
						that.switchSelect();
					});
				}
			},
			addCart: function(index) {
				let that = this;
				let item = that.cartList.valid[index];
				item.buyNumber = Number(item.buyNumber) + 1;
				item.numAdd = false;
				item.numSub = false;
				that.setCartNum(item.proDetailId, 1, function(data) {
					that.cartList.valid[index] = item;
					that.switchSelect();
				});
			},
			setCartNum(proDetailId, buyNumber, successCallback) {
				let that = this;
				addToCar({
					userInfoId: that.$store.state.app.uid,
					proDetailId: proDetailId,
					addNumber: buyNumber
				}).then(res => {
					successCallback && successCallback(res);
				}).catch(err => {
					console.log(err)
					return that.$util.Tips({
						title: err.msg
					});
				})
			},
			getCartData() {
				return new Promise((resolve, reject) => {
					getUserCar({
						userInfoId: this.uid
					}).then((res) => {
						resolve(res.value);
					}).catch((err) => {
						this.loading = false;
						this.canShow = true
						this.$util.Tips({
							title: err.msg
						});
					})
				});
			},
			async getCartList() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});

				let that = this;
				let cartList = await this.getCartData();
				let validList = cartList;
				that.cartCount = cartList.length;

				let numSub = [{
					numSub: true
				}, {
					numSub: false
				}];
				let numAdd = [{
						numAdd: true
					}, {
						numAdd: false
					}],
					selectValue = [];
				if (validList.length > 0) {
					for (let index in validList) {
						console.log(validList[index]);
						if (validList[index].buyNumber == 1) {
							validList[index].numSub = true;
						} else {
							validList[index].numSub = false;
						}
						if (validList[index]) {
							validList[index].checked = true;
							selectValue.push(validList[index].carId);
						} else {
							validList[index].checked = false;
						}
					}
				}
				that.$set(that.cartList, 'valid', validList);
				that.selectValue = selectValue;
				let newArr = validList.filter(item => item.carId);
				that.isAllSelect = newArr.length == selectValue.length && newArr.length;
				that.switchSelect();
				that.loading = false;
				this.canShow = true
				uni.hideLoading();
			},
			goRouter(item) {
				var pages = getCurrentPages();
				var page = (pages[pages.length - 1]).$page.fullPath;
				if (item.link == page) return
				uni.switchTab({
					url: item.link,
					fail(err) {
						uni.redirectTo({
							url: item.link
						})
					}
				})
			},
			manage: function() {
				let that = this;
				that.footerswitch = !that.footerswitch;
				let arr1 = [];
				let arr2 = [];
				let newValid = that.cartList.valid.map(item => {
					if (that.footerswitch) {
						if (item.checked) {
							arr1.push(item.carId);
						}
					} else {
						if (item.checked) {
							arr1.push(item.carId);
						}
					}
					return item;
				});
				that.cartList.valid = newValid;
				if (that.footerswitch) {
					that.isAllSelect = newValid.length === arr1.length + arr2.length;
				} else {
					that.isAllSelect = newValid.length === arr1.length;
				}
				that.selectValue = arr1;
				that.switchSelect();
			},
		},
		onReachBottom() {}
	}
</script>

<style scoped lang="scss">
	.page-footer {
		position: fixed;
		bottom: 0;
		z-index: 30;
		display: flex;
		align-items: center;
		justify-content: space-around;
		width: 100%;
		height: calc(98rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		box-sizing: border-box;
		border-top: solid 1rpx #F3F3F3;
		background-color: #fff;
		box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
		padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
		padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/

		.foot-item {
			display: flex;
			width: max-content;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			position: relative;

			.count-num {
				position: absolute;
				display: flex;
				justify-content: center;
				align-items: center;
				width: 40rpx;
				height: 40rpx;
				top: 0rpx;
				right: -15rpx;
				color: #fff;
				font-size: 20rpx;
				background-color: #FD502F;
				border-radius: 50%;
				padding: 4rpx;
			}
		}

		.foot-item image {
			height: 50rpx;
			width: 50rpx;
			text-align: center;
			margin: 0 auto;
		}

		.foot-item .txt {
			font-size: 24rpx;


			&.active {}
		}
	}

	.shoppingCart {
		/* #ifdef H5 */
		// padding-bottom: 0;
		// padding-bottom: constant(safe-area-inset-bottom);  
		// padding-bottom: env(safe-area-inset-bottom);
		/* #endif */
	}

	.shoppingCart .labelNav {
		height: 76rpx;
		padding: 0 30rpx;
		font-size: 22rpx;
		color: #8c8c8c;
		position: fixed;
		left: 0;
		width: 100%;
		box-sizing: border-box;
		background-color: #f5f5f5;
		z-index: 5;
		top: 0;
	}

	.shoppingCart .labelNav .item .iconfont {
		font-size: 25rpx;
		margin-right: 10rpx;
	}

	.shoppingCart .nav {
		width: 100%;
		height: 80rpx;
		background-color: #fff;
		padding: 0 30rpx;
		box-sizing: border-box;
		font-size: 28rpx;
		color: #282828;
		position: fixed;
		left: 0;
		z-index: 5;
		top: 76rpx;
	}

	.shoppingCart .nav .num {
		margin-left: 12rpx;
	}

	.shoppingCart .nav .administrate {
		font-size: 26rpx;
		color: #282828;
		width: 110rpx;
		height: 46rpx;
		border-radius: 6rpx;
		border: 1px solid #a4a4a4;
	}

	.shoppingCart .noCart {
		margin-top: 171rpx;
		background-color: #fff;
		padding-top: 0.1rpx;
	}

	.shoppingCart .noCart .pictrue {
		width: 414rpx;
		height: 336rpx;
		margin: 78rpx auto 56rpx auto;
		padding: 45rpx;
	}

	.shoppingCart .noCart .pictrue image {
		width: 100%;
		height: 100%;
	}

	.shoppingCart .list {
		margin-top: 171rpx;
	}

	.shoppingCart .list .item {
		padding: 25rpx 30rpx;
		background-color: #fff;
		margin-bottom: 15rpx;
	}

	.shoppingCart .list .item .picTxt {
		width: 627rpx;
		position: relative;
	}

	.shoppingCart .list .item .picTxt .pictrue {
		width: 160rpx;
		height: 160rpx;
	}

	.shoppingCart .list .item .picTxt .pictrue image {
		width: 100%;
		height: 100%;
		border-radius: 6rpx;
	}

	.shoppingCart .list .item .picTxt .text {
		width: 444rpx;
		font-size: 28rpx;
		color: #282828;
	}

	.shoppingCart .list .item .picTxt .text .reColor {
		color: #999;
	}

	.shoppingCart .list .item .picTxt .text .infor {
		font-size: 24rpx;
		color: #868686;
		margin-top: 16rpx;
	}

	.shoppingCart .list .item .picTxt .text .money {
		font-size: 32rpx;
		color: #e93323;
		margin-top: 28rpx;
	}

	.shoppingCart .list .item .picTxt .carnum {
		height: 47rpx;
		position: absolute;
		bottom: 7rpx;
		right: 0;
	}

	.shoppingCart .list .item .picTxt .carnum view {
		border: 1rpx solid #a4a4a4;
		width: 66rpx;
		text-align: center;
		height: 100%;
		line-height: 40rpx;
		font-size: 28rpx;
		color: #a4a4a4;
	}

	.shoppingCart .list .item .picTxt .carnum .reduce {
		border-right: 0;
		border-radius: 3rpx 0 0 3rpx;
	}

	.shoppingCart .list .item .picTxt .carnum .reduce.on {
		border-color: #e3e3e3;
		color: #dedede;
	}

	.shoppingCart .list .item .picTxt .carnum .plus {
		border-left: 0;
		border-radius: 0 3rpx 3rpx 0;
	}

	.shoppingCart .list .item .picTxt .carnum .plus.on {
		border-color: #e3e3e3;
		color: #dedede;
	}

	.shoppingCart .list .item .picTxt .carnum .num {
		color: #282828;
	}

	.shoppingCart .invalidGoods {
		background-color: #fff;
	}

	.shoppingCart .invalidGoods .goodsNav {
		width: 100%;
		height: 66rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		font-size: 28rpx;
		color: #282828;
	}

	.shoppingCart .invalidGoods .goodsNav .iconfont {
		color: #424242;
		font-size: 28rpx;
		margin-right: 17rpx;
	}

	.shoppingCart .invalidGoods .goodsNav .del {
		font-size: 26rpx;
		color: #999;
	}

	.shoppingCart .invalidGoods .goodsNav .del .icon-shanchu1 {
		color: #999;
		font-size: 33rpx;
		vertical-align: -2rpx;
		margin-right: 8rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item {
		padding: 20rpx 30rpx;
		border-top: 1rpx solid #f5f5f5;
	}

	.shoppingCart .invalidGoods .goodsList .item .invalid {
		font-size: 22rpx;
		color: #fff;
		width: 70rpx;
		height: 36rpx;
		background-color: #aaa;
		border-radius: 3rpx;
		text-align: center;
		line-height: 36rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item .pictrue {
		width: 140rpx;
		height: 140rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item .pictrue image {
		width: 100%;
		height: 100%;
		border-radius: 6rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item .text {
		width: 433rpx;
		font-size: 28rpx;
		color: #999;
		height: 140rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item .text .name {
		width: 100%;
	}

	.shoppingCart .invalidGoods .goodsList .item .text .infor {
		font-size: 24rpx;
	}

	.shoppingCart .invalidGoods .goodsList .item .text .end {
		font-size: 26rpx;
		color: #bbb;
	}

	.shoppingCart .footer {
		z-index: 999;
		width: 100%;
		height: 96rpx;
		background-color: #fafafa;
		position: fixed;
		padding: 0 30rpx;
		box-sizing: border-box;
		border-top: 1rpx solid #eee;
		bottom: 0rpx;
		bottom: calc(0rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		// bottom: 98rpx;
		// bottom: calc(98rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		// bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	}

	.shoppingCart .footer.on {
		// #ifndef H5
		bottom: 0rpx;
		// #endif
	}

	.shoppingCart .footer .checkAll {
		font-size: 28rpx;
		color: #282828;
		margin-left: 16rpx;
	}

	// .shoppingCart .footer checkbox .wx-checkbox-input{background-color:#fafafa;}
	.shoppingCart .footer .money {
		font-size: 30rpx;
	}

	.shoppingCart .footer .placeOrder {
		color: #fff;
		font-size: 30rpx;
		width: 226rpx;
		height: 70rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 70rpx;
		margin-left: 22rpx;
	}

	.shoppingCart .footer .button .bnt {
		font-size: 28rpx;
		color: #999;
		border-radius: 50rpx;
		border: 1px solid #999;
		width: 160rpx;
		height: 60rpx;
		text-align: center;
		line-height: 60rpx;
	}

	.shoppingCart .footer .button form~form {
		margin-left: 17rpx;
	}

	.uni-p-b-96 {
		height: 96rpx;
	}

	.uni-p-b-98 {
		height: 100rpx;
		/* 兼容 IOS<11.2 */
		height: calc(100rpx + constant(safe-area-inset-bottom));
		/* 兼容 IOS>11.2 */
		height: calc(100rpx + env(safe-area-inset-bottom));
	}

	.cart-color {
		color: #e93323 !important;
		border: 1px solid #e93323 !important;
	}
</style>

<style>
	page {
		background-color: #f5f5f5 !important;
	}

	uni-checkbox .uni-checkbox-input {
		margin-right: 5px;
		-webkit-appearance: none;
		appearance: none;
		outline: 0;
		border: 1px solid #d1d1d1;
		background-color: #fff;
		border-radius: 3px;
		width: 22px;
		height: 22px;
		position: relative;
	}

	uni-checkbox .uni-checkbox-input {
		border-radius: 50%;
		width: 19px;
		height: 19px;
	}
</style>